package com.ocom.aiotweb.controller;

import com.ocom.aiotweb.service.AccessUpgradePageService;
import com.ocom.aiotweb.vo.accessupgradepage.DeleteVo;
import com.ocom.aiotweb.vo.accessupgradepage.ImportUpgradeVo;
import com.ocom.aiotweb.vo.accessupgradepage.OnShowVo;
import com.ocom.common.constant.AiotUrl;
import com.ocom.common.resp.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class AccessUpgradePageController {

    @Autowired
    private AccessUpgradePageService accessUpgradePageService;
    /**
     * 门禁升级文件列表（AccessUpgradePage/onShow）
     * */
    @PostMapping(AiotUrl.Url_Aiot_AccessUpgradePageOnShow)
    public Result AccessUpgradePageOnShow(@Validated @RequestBody OnShowVo onShowVo){
        return accessUpgradePageService.AccessUpgradePageOnShow(onShowVo);
    }


    /**
     * 文件上传（AccessUpgradePage/importUpgrade）
     * */
    @PostMapping(AiotUrl.Url_Aiot_AccessUpgradePageImportUpgrade)
    public Result AccessUpgradePageImportUpgrade(@Validated @RequestBody ImportUpgradeVo importUpgradeVo){
        return accessUpgradePageService.AccessUpgradePageImportUpgrade(importUpgradeVo);
    }


    /**
     * 升级文件删除（AccessUpgradePage/delete）
     * */
    @PostMapping(AiotUrl.Url_Aiot_AccessUpgradePageDelete)
    public Result AccessUpgradePageDelete(@Validated @RequestBody DeleteVo deleteVo){
        return accessUpgradePageService.AccessUpgradePageDelete(deleteVo);
    }
}
